/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package EA_Model.IEC61970.SCADA.impl;

import EA_Model.IEC61970.Domain.Seconds;

import EA_Model.IEC61970.SCADA.RemoteSource;
import EA_Model.IEC61970.SCADA.SCADAPackage;

import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;

import org.eclipse.emf.ecore.impl.ENotificationImpl;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Remote Source</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link EA_Model.IEC61970.SCADA.impl.RemoteSourceImpl#getDeadband <em>Deadband</em>}</li>
 *   <li>{@link EA_Model.IEC61970.SCADA.impl.RemoteSourceImpl#getScanInterval <em>Scan Interval</em>}</li>
 *   <li>{@link EA_Model.IEC61970.SCADA.impl.RemoteSourceImpl#getSensorMaximum <em>Sensor Maximum</em>}</li>
 *   <li>{@link EA_Model.IEC61970.SCADA.impl.RemoteSourceImpl#getSensorMinimum <em>Sensor Minimum</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class RemoteSourceImpl extends RemotePointImpl implements RemoteSource {
	/**
	 * The cached value of the '{@link #getDeadband() <em>Deadband</em>}' reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getDeadband()
	 * @generated
	 * @ordered
	 */
	protected EA_Model.IEC61970.Domain.Float deadband;

	/**
	 * The cached value of the '{@link #getScanInterval() <em>Scan Interval</em>}' reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getScanInterval()
	 * @generated
	 * @ordered
	 */
	protected Seconds scanInterval;

	/**
	 * The cached value of the '{@link #getSensorMaximum() <em>Sensor Maximum</em>}' reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getSensorMaximum()
	 * @generated
	 * @ordered
	 */
	protected EA_Model.IEC61970.Domain.Float sensorMaximum;

	/**
	 * The cached value of the '{@link #getSensorMinimum() <em>Sensor Minimum</em>}' reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getSensorMinimum()
	 * @generated
	 * @ordered
	 */
	protected EA_Model.IEC61970.Domain.Float sensorMinimum;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected RemoteSourceImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	protected EClass eStaticClass() {
		return SCADAPackage.Literals.REMOTE_SOURCE;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EA_Model.IEC61970.Domain.Float getDeadband() {
		if (deadband != null && deadband.eIsProxy()) {
			InternalEObject oldDeadband = (InternalEObject)deadband;
			deadband = (EA_Model.IEC61970.Domain.Float)eResolveProxy(oldDeadband);
			if (deadband != oldDeadband) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE, SCADAPackage.REMOTE_SOURCE__DEADBAND, oldDeadband, deadband));
			}
		}
		return deadband;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EA_Model.IEC61970.Domain.Float basicGetDeadband() {
		return deadband;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setDeadband(EA_Model.IEC61970.Domain.Float newDeadband) {
		EA_Model.IEC61970.Domain.Float oldDeadband = deadband;
		deadband = newDeadband;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, SCADAPackage.REMOTE_SOURCE__DEADBAND, oldDeadband, deadband));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Seconds getScanInterval() {
		if (scanInterval != null && scanInterval.eIsProxy()) {
			InternalEObject oldScanInterval = (InternalEObject)scanInterval;
			scanInterval = (Seconds)eResolveProxy(oldScanInterval);
			if (scanInterval != oldScanInterval) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE, SCADAPackage.REMOTE_SOURCE__SCAN_INTERVAL, oldScanInterval, scanInterval));
			}
		}
		return scanInterval;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Seconds basicGetScanInterval() {
		return scanInterval;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setScanInterval(Seconds newScanInterval) {
		Seconds oldScanInterval = scanInterval;
		scanInterval = newScanInterval;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, SCADAPackage.REMOTE_SOURCE__SCAN_INTERVAL, oldScanInterval, scanInterval));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EA_Model.IEC61970.Domain.Float getSensorMaximum() {
		if (sensorMaximum != null && sensorMaximum.eIsProxy()) {
			InternalEObject oldSensorMaximum = (InternalEObject)sensorMaximum;
			sensorMaximum = (EA_Model.IEC61970.Domain.Float)eResolveProxy(oldSensorMaximum);
			if (sensorMaximum != oldSensorMaximum) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE, SCADAPackage.REMOTE_SOURCE__SENSOR_MAXIMUM, oldSensorMaximum, sensorMaximum));
			}
		}
		return sensorMaximum;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EA_Model.IEC61970.Domain.Float basicGetSensorMaximum() {
		return sensorMaximum;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setSensorMaximum(EA_Model.IEC61970.Domain.Float newSensorMaximum) {
		EA_Model.IEC61970.Domain.Float oldSensorMaximum = sensorMaximum;
		sensorMaximum = newSensorMaximum;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, SCADAPackage.REMOTE_SOURCE__SENSOR_MAXIMUM, oldSensorMaximum, sensorMaximum));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EA_Model.IEC61970.Domain.Float getSensorMinimum() {
		if (sensorMinimum != null && sensorMinimum.eIsProxy()) {
			InternalEObject oldSensorMinimum = (InternalEObject)sensorMinimum;
			sensorMinimum = (EA_Model.IEC61970.Domain.Float)eResolveProxy(oldSensorMinimum);
			if (sensorMinimum != oldSensorMinimum) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE, SCADAPackage.REMOTE_SOURCE__SENSOR_MINIMUM, oldSensorMinimum, sensorMinimum));
			}
		}
		return sensorMinimum;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EA_Model.IEC61970.Domain.Float basicGetSensorMinimum() {
		return sensorMinimum;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setSensorMinimum(EA_Model.IEC61970.Domain.Float newSensorMinimum) {
		EA_Model.IEC61970.Domain.Float oldSensorMinimum = sensorMinimum;
		sensorMinimum = newSensorMinimum;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, SCADAPackage.REMOTE_SOURCE__SENSOR_MINIMUM, oldSensorMinimum, sensorMinimum));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
		switch (featureID) {
			case SCADAPackage.REMOTE_SOURCE__DEADBAND:
				if (resolve) return getDeadband();
				return basicGetDeadband();
			case SCADAPackage.REMOTE_SOURCE__SCAN_INTERVAL:
				if (resolve) return getScanInterval();
				return basicGetScanInterval();
			case SCADAPackage.REMOTE_SOURCE__SENSOR_MAXIMUM:
				if (resolve) return getSensorMaximum();
				return basicGetSensorMaximum();
			case SCADAPackage.REMOTE_SOURCE__SENSOR_MINIMUM:
				if (resolve) return getSensorMinimum();
				return basicGetSensorMinimum();
		}
		return super.eGet(featureID, resolve, coreType);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eSet(int featureID, Object newValue) {
		switch (featureID) {
			case SCADAPackage.REMOTE_SOURCE__DEADBAND:
				setDeadband((EA_Model.IEC61970.Domain.Float)newValue);
				return;
			case SCADAPackage.REMOTE_SOURCE__SCAN_INTERVAL:
				setScanInterval((Seconds)newValue);
				return;
			case SCADAPackage.REMOTE_SOURCE__SENSOR_MAXIMUM:
				setSensorMaximum((EA_Model.IEC61970.Domain.Float)newValue);
				return;
			case SCADAPackage.REMOTE_SOURCE__SENSOR_MINIMUM:
				setSensorMinimum((EA_Model.IEC61970.Domain.Float)newValue);
				return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eUnset(int featureID) {
		switch (featureID) {
			case SCADAPackage.REMOTE_SOURCE__DEADBAND:
				setDeadband((EA_Model.IEC61970.Domain.Float)null);
				return;
			case SCADAPackage.REMOTE_SOURCE__SCAN_INTERVAL:
				setScanInterval((Seconds)null);
				return;
			case SCADAPackage.REMOTE_SOURCE__SENSOR_MAXIMUM:
				setSensorMaximum((EA_Model.IEC61970.Domain.Float)null);
				return;
			case SCADAPackage.REMOTE_SOURCE__SENSOR_MINIMUM:
				setSensorMinimum((EA_Model.IEC61970.Domain.Float)null);
				return;
		}
		super.eUnset(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public boolean eIsSet(int featureID) {
		switch (featureID) {
			case SCADAPackage.REMOTE_SOURCE__DEADBAND:
				return deadband != null;
			case SCADAPackage.REMOTE_SOURCE__SCAN_INTERVAL:
				return scanInterval != null;
			case SCADAPackage.REMOTE_SOURCE__SENSOR_MAXIMUM:
				return sensorMaximum != null;
			case SCADAPackage.REMOTE_SOURCE__SENSOR_MINIMUM:
				return sensorMinimum != null;
		}
		return super.eIsSet(featureID);
	}

} //RemoteSourceImpl
